import {useState, Component,useImperativeHandle,forwardRef} from 'react'; 
 


class Child extends Component {
    
  constructor(props) {
    super(props);
    this.state = {
      date: new Date()
    };
  }

  handleLog = () => {
    console.log("Child Component");
    this.setState({
      date: new Date()
    });
  };
  render() { 
    const { props } = this;

    return <div>
      count: {props.count}
      <h2>现在是 {this.state.date.toLocaleTimeString()}.</h2>
    </div>;
  }
}

export default Child;
// https://blog.csdn.net/weixin_43844392/article/details/106577324